package com.servicebuck.ui.model;

import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import com.servicebuck.ui.UIController;

@ManagedBean(name="regbean")
@SessionScoped
public class RegistrationBean {

	private String emailId;
	private String password;
	private String firstName;
	private String lastName;
	
	public RegistrationBean(){
		
	}
	public String getEmailId() {
		return emailId;
	}
	public void setEmailId(String emailId) {
		this.emailId = emailId;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}	
	
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	public String register(){
		try{
			UIController.registerUser(emailId, password);
			return "success";
		}catch(Exception ex){
			return "failure";
		}
	}	
}
